package com.zhuky.task;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import com.zhuky.entity.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class TestTask {

	private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
	@Autowired
	private Resource resource;
	@Scheduled(fixedRate = 3000)
	public void reportCurrentTime() {

		log.info("当前时间：{}", format.format(new Date()));
		log.info("Resource：{}" ,resource);
	}
}
